<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<div class="tableoptions">
                	<button onclick="window.location.href='<?php echo base_url() ?>admin/perizinan_tambah'" class="deletebutton radius3" title="Tambah Data">Input Perizinan</button> &nbsp; <button onclick="window.location.href='<?php echo base_url() ?>admin/perizinan_tambah'" class="deletebutton radius3" title="Tambah Santri Baru">Halaman Konfirmasi Bayar(via Transfer)</button>&nbsp; <button onclick="window.location.href='<?php echo base_url() ?>admin/laporan_perizinan'" class="deletebutton radius3" title="Tambah Santri Baru">Download Excel</button>
<br><b>Filter Data :</b><br><form>
                  <select name="URL" onchange="window.location.href=this.form.URL.options[this.form.URL.selectedIndex].value" class="smallsel">
                     <option value="<?php echo base_url();?>admin/perizinan_ta/<?php echo $hm->id_ta;?>"><?php echo $hm->id_ta;?></option>
                  </select></form>
                </div><!--tableoptions-->	
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="stdtable">
                    <colgroup>
                        <col class="con0" />
                        <col class="con1" />
                        <col class="con0" />
                        <col class="con1" />
                        <col class="con0" />
                        <col class="con1" />
                        <col class="con0" />
                        <col class="con1" />
                    </colgroup>
                    <thead>
  <tr>
    <td width="7%" align="left">ID</td>
    <td width="14%" align="left">Nama Lengkap</td>
    <td width="8%" align="left">Keperluan</td>
    <td width="17%">Tanggal Izin</td>
    <td width="17%">Tanggal Kembali</td>
    <td width="9%">Telat</td>
    <td width="9%">Status</td>
    <td width="12%">Kembali</td>
    <td width="8%" class="center">Aksi</td>
  </tr>
  					</thead>
<?php $no=1; foreach ($homes as $hm): ?>
  <tr>
   	<td width="7%" align="left"><?php echo $hm->id_perizinan;?></td>
    <td width="14%" align="left"> <?php $users=$hm->id_santri;
  $s2=$this->admin_model->getNamaSantriById($users);
  echo $s2['nama_lengkap'];
?></td>
    <td width="8%" align="left"><?php echo $hm->jenis_ijin;?></td>
    <td width="17%"><?php echo $hm->waktu_pergi;?></td>
    <td width="17%"><?php echo $hm->waktu_datang;?></td>
    <td width="9%" align="left"><?php 
$dayinpass = $hm->waktu_pergi;
$today = time();
$dayinpass= strtotime($dayinpass);
$bil=round(abs($today-$dayinpass)/60/60);
$sip=24;
$hokey=$bil/$sip;
echo floor($hokey)." Hari | ".$bil." Jam"; 
?></td>
    <td width="9%" align="left"><?php echo $hm->status;?></td>
    <td width="12%"><?php echo $hm->tanggal_kembali;?></td>
    <td width="8%" align="center"><a href="<?php echo base_url() ?>admin/perizinan_edit/<?php echo $hm->id_perizinan;?>" class="edit"><i class="fa fa-gear fa-2x"></i></a> &nbsp;<a href="<?php echo base_url() ?>admin/cproc_perizinan_hapus/<?php echo $hm->id_perizinan;?>" class="delete" onClick="return confirm('Apakah Anda Ingin menghapus data ini ?')"><i class="fa fa-minus-square fa-2x"></i></a></td>
  </tr>
<?php endforeach; ?> 
</table><br>
<center><?php echo $halaman;?></center>

